<template>
  <div class="plugin-nuxt">
    <h2>plugin-nuxt</h2>
  </div>
</template>

<script setup lang="ts">
  const nuxtApp = useNuxtApp();
  nuxtApp.provide("formData", () => {
    return "2023-01-01";
  });

  nuxtApp.provide("version", "1.0.0");

  // 使用插件
  console.log(nuxtApp.$formData);
  console.log(nuxtApp.$version);
  if (process.client) {
    console.log(nuxtApp.$formPrice(100.78987));
  }
</script>

<style lang="less" scoped>
  .plugin-nuxt {
  }
</style>
